This invention relates to a method of assigning hints and a method of constructing a font file. More particularly, the invention relates to a hint assignment method and a font file construction method in outline font technology, wherein the outline of a character is cut into strokes or parts, the outline of each stroke or part (character element) is defined, a character is expressed by a collection of elements and, in outputting a character, the outline of a character element is developed into a bitmap image and then outputted.
The Japanese language, which employs three different character sets referred to as kanji, hiragana and katakana (these characters shall be referred to collectively as "Japanese characters") differs greatly from the European languages that employ one character set, namely the Roman alphabet. In general, hiragana and katakana (referred to collectively as kana) are designed to be somewhat smaller than kanji and it is possible to combine separately designed kanji and separately designed kana.
A Japanese character is formed inside a design frame referred to as a "body". Unlike the Roman alphabet, in which characters can have different widths from one character to the next, the widths of Japanese characters do not change from character to character. Further, whereas the longitudinal line in the alphabetic character "P", for example, is designed to be vertical, the two longitudinal lines in the kanji are designed to converge slightly at their lower ends in certain styles of type. The reason for this design is to compensate for the illusion of a "top heaviness", which gives the character an unstable appearance. Such compensation for optical illusions is a characteristic of kanji.
Furthermore, since some kanji are composed of many vertical and/or horizontal lines, achieving balance among these lines is important. The blank space between two lines is referred to as "white space". Reproducing a white space to have the same balance as that possessed by the original design is one requirement in achieving a character having high quality.
When a kanji character having these features is expressed by a collection of very small dots, it is difficult to achieve a fine representation smaller than the size of the individual dots. When the number of dots is small, not only is it impossible to represent slender portions of the original design but there are even instances where all horizontal or vertical lines in the character cannot be properly spaced. Such improper spacing produces a deteriorated, indistinct character whose lines run together. In a situation where the number of dots is too small to express a character design, the only function left for the character is merely the transmission and/or recording of information. In such cases, therefore, the chief aim is to prevent character deterioration, rather than to provide attractive design, in order to improve legibility. The question of design, i.e., as to which style of type is being used, is no longer important.
In the case of a bitmap font in which an optimum character pattern is formed by the human hand, a technique employed to prevent character deterioration and maintain legibility is to change the balance of the overall character or thin out some of the vertical or horizontal lines. In the case of a character composed of 16.times.16 dots used to present a display on the screen of a personal computer or word processor, the above-mentioned technique usually is employed. Since the lines thinned out are selected with great care, there are instances where they cannot be noticed at a glance.
However, when a plurality of sizes are required, character patterns conforming to the various sizes must be prepared for bitmap fonts, thus necessitating a memory having a large storage capacity. In order to reproduce characters of various sizes using a small quantity of data without sacrificing the style of the printing type, there has been a shift from bitmap fonts in favor of outline fonts. As shown in FIG. 34, an outline font is one in which the contour of the character is expressed by coordinates in a 1000.times.1000 XY coordinate system. The contour data are outputted upon being bitmapped by a character generating program. With such outline fonts, multiple-point designation (the designation of different printing sizes) is possible. Character quality can be maintained without compromising the style of the printing type regardless of how large the character is made.
Unfortunately, however, outline font techniques presently available have a disadvantage. Specifically, the smaller the point size at which a character is made, the greater the decline in character quality produced and the more unattractive the form of the character appears to the naked eye. This is due to rounding error, which arises when the contour of a character expressed in a 1000.times.1000 XY coordinate system is expressed in a physical coordinate system of m.times.m dots (e.g., 16.times.16 dots). FIGS. 35A, 35B are examples of samples of characters outputted using conventional outline fonts and bitmap fonts. FIG. 35A illustrates a sample based upon conventional outline fonts, and FIG. 35B shows an example based upon bitmap fonts. The characters in the upper row of each Figure are composed of 24.times.24 dots, the characters at the left of each lower row are composed of 18.times.18 dots, and the characters at the right of each lower row are composed of 14.times.14 dots. If the number of dots is large, a difference in quality between outline fonts and bitmap fonts is not noticeable. When character size is made small, however, the difference between these fonts manifests itself clearly. Specifically, with the outline fonts of 18.times.18 dots, the sizes of the characters are not uniform (the kanji is larger than the other characters). With the outline fonts of 14.times.14 dots, portions of some characters are made indistinct by deterioration. In the case of the bitmap fonts, the fonts are formed by thinning out portions of the vertical or horizontal lines to prevent deterioration and maintain legibility and to change the overall balance when the number of dots is small. As a result, character deterioration and a variance in character size can be prevented. FIG. 35C illustrates character samples based upon fonts composed of parts in accordance with the present invention, described later.
Thus, with the conventional outline font techniques, fine processing cannot be executed, as is possible with bitmap fonts. When character size is reduced, a variance in size occurs and the characters deteriorate. The reason for this is the occurrence of rounding error, as mentioned above, and the fact that "camouflage" utilizing visual characteristics cannot be applied. Furthermore, with processing using the conventional outline fonts, there are instances where slender character portions that appear needless to the human eye are reproduced as emphasized. This occurs because it is not possible to determine which portions of a character are important for the purpose of improving legibility.
In summary, therefore, bitmap fonts created by the human hand have a high quality but require a large memory capacity and do not satisfy the needs of the DTP (desktop publishing) age. On the other hand, the conventional outline fonts are suitable for DTP. However, since the character images are generated by processing, there is a decline in quality where small characters are concerned.
Accordingly, there is a need to be able to generate character images having a high quality equivalent to that of bitmap fonts but by using outline fonts.
A kanji character is by nature a collection of a plurality of vertical and/or horizontal lines. With the conventional outline font technique, however, all of the vertical and horizontal lines are lumped together to express contour lines, as a result of which the above-described problems arise. Accordingly, as illustrated in FIG. 36, contours are partitioned into single strokes [strokes STi (i=1, 2, . . . )] such as vertical lines, horizontal lines, oblique lines, right sweeps and left sweeps, the contours are expressed per each stroke STi, the character is captured as a collection of these strokes, the contour data of each stroke are bitmapped by a character generating program and the bitmap is outputted. If this expedient is adopted, the relationship between vertical lines or horizontal lines, etc., is clarified. Moreover, which portions of a character are important and which are unnecessary for the purpose of improving legibility can be ascertained to make various types of control possible.
It is possible to build upon this concept. Specifically, in case of a small character size, recognition of the form of the character is more important than a difference in the style of type. Therefore, if information (basic stroke information) representing the form of the character and information (contour information) representing the style of type can be separated, high-quality characters can be generated from small-size characters, in which legibility is important, to large-size characters, in which reproduction of the distinctive quality of the style of type is important. The basic stroke information mentioned here is information about the basic structure of the character form and is not information regarding central lines that flesh out a character.
Accordingly, there developed an outline font technique which includes (1) separating each character into strokes using basic stroke (skeleton) information, (2) dividing the strokes into parts, (3) defining the contour of each part and expressing the character as a collection of the parts, and (4), in outputting the character, developing the contours of the parts constructing the character into a bitmap image and outputting the bitmap image of the character.
FIG. 37 is a diagram for describing a character, strokes and parts. This illustrates a case where the kanji character is separated into strokes (a character-to-stroke cut) and the strokes are divided into parts (a stroke-to-part cut). The collection of the parts forms the contour information. In FIG. 37, the "elements" are illustrated to expedite the explanation and are not units used in actual processing. The kanji character is separated into a number of strokes, each stroke is cut into parts (a starting part, a middle part and an end part) appropriately, and the parts form the contour information.
FIG. 38 is a diagram for describing basic stroke information. A stroke number is assigned to each stroke in accordance with the order in which a character is written, and stroke disposition data (starting point and end point) of the strokes and stroke codes indicating the types of strokes are assigned in the order of the stroke numbers to construct the information. FIG. 38 illustrates the basic stroke information of the kanji character
As shown in FIGS. 39A and 39B, the contour shape of each part is expressed by arraying, in the counter-clockwise direction, the coordinate values (in the part coordinate system) of the points P1.about.P6, Q1.about.Q4 of the part outlines. FIG. 39A illustrates the shape of the starting part of the kanji character and FIG. 39B illustrates the shape of the end part of the kanji character
FIG. 40 is a diagram for describing the structure of a font file in which a character is expressed by a collection of parts. The file includes a header field 1a for storing various font-related information such as the font name and the date of its creation, and a character pointer field 1b which stores a character pointer for pointing to a parts pointer string conforming to the character code. A part pointer field 2 stores (1) disposition data of all parts constructing the character, and (2) pointers to part contour data. A contour data field 3 stores part contour data of all parts. The part disposition data in the part pointer field 2 indicate where in the outline font coordinate system (a coordinate system of 1000.times.1000 dots) a part is disposed. Specifically, the part disposition data indicate the positional coordinates of the part origin (see FIGS. 39A, 39B) in the character coordinate system. As shown in FIGS. 41A and 41B, the disposition data illustrated in FIG. 40 is for a case where the part origin of the starting part of the lowermost horizontal stroke (horizontal line) in the kanji character is given by (56,493), the part origin of the middle part is given by (111,493) and the part origin of the end part is given by (953,493).
When an outline font expressed in a logical coordinate system is reduced to a target size, decimals are always produced. However, since an output by printing or by display on a display screen can only be performed in the form of individual dots, numbers with decimal portions must be made whole numbers as by being rounded off. Rounding error is always produced by this operation for attaining whole numbers and causes a decline in character quality. Accordingly, hint information is assigned to the contour shape data of parts in order to prevent a decline in character quality.
Hint information is control information assigned to a contour shape which is important in terms of deciding character quality. Examples of hints are a hint (referred to as a stem hint) for controlling line width, a hint (referred to as a scale hint) for controlling the hari-portion of a Kanji character designed for a style of type, and a rounded Gothic hint for clearly manifesting the roundness of rounded Gothic type.
FIGS. 42A through 42C are diagrams for describing a stem hint. Assume that when an outline font expressed by a logical coordinate system of 1000.times.1000 dots is reduced in size for the purpose of effecting a size conversion to a physical coordinate system of, say, 16.times.16 dots, the Y coordinates of points A, B have become 6.5 and 5.3, respectively, as shown in FIG. 42A. In such case the conversion is made to the physical coordinate system by rounding off each of the Y coordinates to the nearest whole number (i.e., by applying a grid correction). As a result, the Y coordinate of point A becomes 7, the Y coordinate of point B becomes 5 and the line width becomes 2, as shown in FIG. 42B. However, since the actual line width is 1.2 (=6.5-5.3), this is rounded off to 1. Thus, if hint control of some kind is not assigned, the line width will become 2 and the output thereof will be too thick. The result will be the output of a character that is widely different from the character originally designed. In other words, character quality declines.
Accordingly, absolute stem hint information as is assigned to point A of the outline font, and relative hint information rs is assigned to the point B of the outline font. When such hint information is assigned, the effects are as follows: When the Y coordinate of point A (to which the absolute stem hint as has been assigned) is rounded off to 5, the discarded fraction 0.3 (=5.3-5.0) is subtracted from the Y coordinate 6.5 of point B (to which the relative hint information has been assigned), with the result that 6.2 (6.5-0.3) is rounded off to the nearest whole number. Accordingly, the Y coordinate of point B becomes 6 and the line width can be made 1, as shown in FIG. 42C. This makes it possible to prevent a decline in character quality.
FIGS. 43A through 43C and FIGS. 44A through 44C are diagrams for describing a scale hint. In a case where outline font data are reduced or enlarged in a logical coordinate system, results of the kind shown in FIG. 43A are obtained as the coordinates of each of the points on the curves. With the conventional method, the coordinates of each point in the logical coordinate system are rounded off to the nearest whole numbers (by the grid correction) to implement the conversion to the physical coordinate system, as shown in FIG. 43B. A bitmap is obtained based upon these data in the physical coordinate system, as depicted in FIG. 43C.
According to this conventional method, however, the dot representation of the scales is enlarged when the grid correction is applied, the scales become larger than the stem width D of the stroke and the character balance is lost. Accordingly, when the grid correction is applied at scale point a, a change dy, which is produced when the Y coordinate value of point e possessing the stem hint is subjected to the grid correction, is added to the Y coordinate value of the point a of the scale hint, as illustrated in FIG. 44A. As a result, the distance between the stem hint point e of a middle part PM and the scale hint a of an end part P.sub.E in the logical coordinate system is preserved. The Y coordinate of the scale hint point a is subjected to the grid correction under these conditions, as depicted in FIG. 44B. Thereafter, a bitmap is generated, as shown in FIG. 44C, based upon the grid-corrected data in the physical coordinate system. If this arrangement is adopted, the dot representation of the scales becomes smaller and a decline in character quality can be prevented.
In this outline font technology for cutting the outline of a character into parts, defining the outline of each part, expressing the character by the collection of the parts and, in outputting the character, developing the outlines of the parts constructing the character into bitmap images and then outputting the images of the character, it is required that hints be assigned to strokes or parts efficiently.
Further, even if data can be shared, the font file produced by the above-described outline font technology possesses these data for each part. As a result, the font file is large in size and a memory having a large storage capacity is required.